package com.bensonbasement.snorflux.server.world.prototypes;

import com.bensonbasement.snorflux.server.world.BigEntity;
import com.bensonbasement.snorflux.server.world.World;

public class BigEntityPrototype extends EntityPrototype {

	public static final BigEntityPrototype BIGENTITY;
	static {
		BIGENTITY = new BigEntityPrototype("core_bigentity",EntityPrototype.ENTITY);
		BIGENTITY.setVisionBlocker(false);
	}
	
	private Boolean visionBlocker = null;
	
	private BigEntityPrototype(String prototypeID, EntityPrototype parent) {
		super(prototypeID, parent);
	}
	
	public BigEntityPrototype(String prototypeID, BigEntityPrototype parent) {
		super(prototypeID, parent);
	}
	
	public void setVisionBlocker(boolean visionBlocker) {
		this.visionBlocker = visionBlocker;
	}

	public Boolean isVisionBlocker() {
		return visionBlocker;
	}
	
	public boolean findVisionBlocker() {
		if (this.visionBlocker != null) {
			return this.visionBlocker;
		}
		else {
			return ((BigEntityPrototype) this.getParent()).findVisionBlocker();
		}
	}
	
	public BigEntity instantiate(World world) {
		BigEntity entity = new BigEntity(world,this);
		return entity;
	}
}
